<html lang="cn">
    <head>
        <meta charset="UTF-8">
        <title>
            ECMALL安装向导
        </title>
        <link rel="stylesheet" type="text/css" href="http://cdn.amazeui.org/amazeui/2.7.1/css/amazeui.min.css">
        <script src="http://cdn.bootcss.com/jquery/1.10.0/jquery.min.js" type="text/javascript">
</script>
        <script type="text/javascript" src="http://cdn.amazeui.org/amazeui/2.7.1/js/amazeui.min.js">
</script>
        <script type="text/javascript" src="http://cdn.amazeui.org/amazeui/2.7.1/js/amazeui.ie8polyfill.min.js">
</script>
        <script type="text/javascript" src="http://cdn.amazeui.org/amazeui/2.7.1/js/amazeui.widgets.helper.min.js">
</script>
        <link rel="stylesheet" type="text/css" href="<?php echo $res;?>/css/main.css">
    </head>
    <body>
        <div class="am-g am-g-fixed">
            <div class="am-g">
                <div class="am-u-sm-12 am-zx-nav">
                    <h1>
                        ECMALL系统安装向导
                    </h1>
                </div>
            </div>
            <div class="am-g am-zx-main">
                <div class="am-u-sm-3">
                    <span class='am-radio-remark'>此功能专用于ECMALL以及相关系统的在线安装面板,ECMOS是属于ECMALL进行定制的整合版，包括，积分，资金，合并订单，多级分销，微信，等多功能于一体的，可升级及维护的整合版。</span>
                </div>
                <div class="am-u-sm-9">
                    <h3>
                        配置安装信息与版本选择
                    </h3>
                    <hr data-am-widget="divider" style="" class="am-divider am-divider-default">
                    <form class="am-form am-zx-form" action="index.php?action=setup_one" method="post" target="pop_warning" ><!--  -->
                        <fieldset>
 					<h3>
                        版本选择
                    </h3>
                            <div class="am-radio">
                                <label><input type="radio" name="vertype" value="free" checked> 免费版本</label>&nbsp;&nbsp;<span class='am-radio-remark'>免费版本提供在线升级，且用户可以到平台反馈问题。</span>
                            </div>
                            <div class="am-radio">
                                <label><input type="radio" name="vertype" value="money"> 收费版本</label>&nbsp;&nbsp;<span class='am-radio-remark'>收费版本提供在线升级，且用户可以到平台反馈问题，提供更快速的响应处理以及升级频率。</span>
                            </div>
                            <div class="am-radio">
                            <label><input type="radio" name="vertype" value="cloud"> 云端版本</label>&nbsp;&nbsp;<span class='am-radio-remark'>云端版本提供在线升级，BUG处理,并且云端版本支持新的模板引挚，仅可在云端在线安装，用户不可以自行安装</span>
                            </div>
                            <div class="free_main" >
                                <div class="am-form-group">
                                    <label for="doc-ipt-email-1">域名</label> <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="domain" placeholder="输入域名">
                                </div>
                                <div class="am-form-group am-zx-webkey" style="display: none;">
                                    <label for="doc-ipt-pwd-1">网站KEY</label> <input type="text" class="am-input-sm" id="doc-ipt-pwd-1" name="key" placeholder="输入网站KEY">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="doc-ipt-email-1">可用版本列表</label><br>
                                <select name="selversion" id="selversion" data-am-selected="{maxHeight: 100}">
								 
								</select>								                               
                            </div>
                             <div class="am-form-group">
                                <label for="doc-ipt-email-1">版本说明</label><br>
                                <div class="version_remark"></div>                                                            
                            </div>
                            <p>
                                <button type="button" class="am-btn am-btn-warning am-zx-submit">提交</button>
                            </p>
                        </fieldset>
                    </form>
                </div>
            </div>
            <div class="am-g">
                <footer data-am-widget="footer"  class="am-footer am-footer-default"   data-am-footer="{  }">
                    <div class="am-footer-switch">
                        <span class="am-footer-ysp" data-rel="mobile"  >ECMALL在线安装系统</span>
                        <span class="am-footer-divider">|</span>
                        <a  class="am-footer-desktop" href="http://bug.360cd.cn">BUG反馈系统</a>
                        <span class="am-footer-divider">|</span>
                        <a  class="am-footer-desktop" href="http://app.360cd.cn">在线应用市场</a>
                    </div>
                    <div class="am-footer-miscs ">

                        <p>
                            由
                            <a href="http://www.360cd.cn/" title="卓信电商" target="_blank" class="">360cd.cn</a>
                            提供技术支持
                        </p>
                        <p>CopyRight©2018  成都卓信品诚科技有限公司</p>
                        <p>蜀ICP备14000816号-1</p>
                    </div>
                </footer>

      <data class="zx-data" style="display: none">
          <item></item>
      </data>

            </div>
        </div>
<script type="text/javascript">
	$(document).ready(function() {
        $('input[name=vertype]').click(function(){
            var val=$(this).val();
            $("#selversion option").remove();
            if(val =='free')
            {
                $('.am-zx-webkey').hide();
            }else{                
                $('.am-zx-webkey').show();
            }
            getVerList(val);
        });
        getVerList('free');
        $('.am-zx-submit').click(function(){
        	showLoading();
        	$(".am-zx-form").submit();
        });

    });
    function bindSelversion()
    {
        $('#selversion').change(function(){
            var code=$(this).val();
            var html=$('item.zx-data-item-'+code).html();
            $('.version_remark').html(html);
        })
    }
    function getVerList(vtype)
    {
    	$.getJSON('<?php echo $remote_url;?>/rapi/', {'act': 'getVersionList','version_type':vtype}, function(data) {
    			/*optional stuff to do after success */
    			if(data.status)
    			{
    				$("#selversion").append("<option value='0'>未选择</option>");
    				for(var i in data.result)
    				{
    					$("#selversion").append("<option value='"+data.result[i].code+"'>"+data.result[i].name+"</option>"); 
                        $("data.zx-data").append("<item class='zx-data-item-"+data.result[i].code+"'>"+data.result[i].remark+"</item>");
    				}
                    bindSelversion();
    			}else{
    				alert('不能拉取远程版本');
    			}
    	});

    }

    function showLoading()
    {
    	$('#my-modal-loading').modal({width:'200px',height:'130px'});
    }
    function hideLoading()
    {
    	$('#my-modal-loading').modal('close');
    }

    function installSuccess()
    {
    	hideLoading();
    	alert('安装成功');
    	window.location.href="/install/";
    }
</script>
	
<div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading">
  <div class="am-modal-dialog">
    <div class="am-modal-hd"><h4>系统安装中请稍等...</h4></div>
    <div class="am-modal-bd">
      <span class="am-icon-spinner am-icon-spin">
    
      </span>
    </div>
  </div>
</div>

	<style type="text/css">
	#my-modal-loading .am-modal-bd span{
		font-size: 5rem;
	}
    .am-radio-remark,.version_remark{
        font-size: 0.9rem;
    }
	

</style>

 <iframe name="pop_warning" style="display:none"></iframe>
    </body>
</html>